import React from 'react'
import { Button } from 'antd'
import styles from './index.less'

const LangButton = (props) => {
  const { language, onChangeLanguage } = props
  if (language === 'zh_CN') {
    return (
      <Button className={styles.languageButton} onClick={() => onChangeLanguage(null)}>中</Button>
    )
  } else {
    return (
      <Button className={styles.languageButton} onClick={() => onChangeLanguage('zh_CN')}>En</Button>
    )
  }
}

export default LangButton
